#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
/*
 * Copyright © 2014, Finium Sdn Bhd, All Rights Reserved
 * 
 * ThreadLocalErrorContext.java
 * Modification History
 * *************************************************************
 * Date				Author						Comment
 * Sep 5, 2013		Alvin Leong Chee Foo		Created
 * Sep 24, 2013		Venkaiah Chowdary Koneru	Renamed
 * *************************************************************
 */
package ${package}.support.threadlocals;

import java.util.List;

/**
 * @author Alvin Leong Chee Foo
 * 
 */
public final class ThreadLocalErrorContext
{
    private static final ThreadLocal<List<String>> THREAD_LOCAL_ERRORS = new ThreadLocal<List<String>>();

    /**
     * set errors
     * 
     * @param errors
     */
    public static void set(List<String> errors)
    {
        THREAD_LOCAL_ERRORS.set(errors);
    }

    /**
     * remove a particular errors list from the thread local data.
     */
    public static void unset()
    {
        THREAD_LOCAL_ERRORS.remove();
    }

    /**
     * get list of error codes for the passed in key.
     * 
     * @return list of errors
     */
    public static List<String> get()
    {
        return THREAD_LOCAL_ERRORS.get();
    }

    /**
     * Constructor. Private to prevent unnecessary instantiation.
     */
    private ThreadLocalErrorContext()
    {
    }
}
